import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export default new Router({
    routes: [
        {
            path: '/',
            redirect: '/dashboard'
        },
        {
            path: '/',
            component: () => import(/* webpackChunkName: "home" */ '../components/common/Home.vue'),
            meta: { title: '自述文件' },
            children: [
                {
                    path: '/dashboard',
                    name:'dashboard',
                    component: () => import('../components/page/Dashboard.vue'),
                    meta: { title: '系统首页' }
                },
                {
                    path: '/user',
                    name:'user',
                    redirect:{name:'userList'},
                    component: () => import('../components/page/user/User.vue'),
                    meta: { title: '用户管理' },
                    children:[
                        {
					        path: '/userList',
                            name:'userList',
					        component: () => import('../components/page/user/List.vue'),
					        meta: { title: '用户列表' }
					    }
                    ]
                },
                // {
                //     path: '/Detailed',
                //     component: () => import(/* webpackChunkName: "tabs" */ '../components/page/merchant/Detailed.vue'),
                //     meta: { title: '商户详情' }
                // },
                {
                    path: '/merchant',
                    name:'merchant',
                    redirect:{name:'merchantSetting'},
                    component: () => import('../components/page/merchant/Merchant.vue'),
                    meta: { title: '商户管理' },
                    children:[
                        {
					        path: '/merchantSetting',
                            name:'merchantSetting',
					        component: () => import('../components/page/merchant/Setting.vue'),
					        meta: { title: '商户管理' }
					    },
                        {
					        path: '/merchantSort',
                            name:'merchantSort',
					        component: () => import('../components/page/merchant/Sort.vue'),
					        meta: { title: '商户排名' }
					    },
                        {
                            path: '/Detailed',
                            name:'Detailed',
                            component: () => import('../components/page/merchant/Detailed.vue'),
                            meta: { title: '商户详情' }
                        },
                    ]
                },
                {
                    path: '/serve',
                    name:"serve",
                    redirect:{name:'serveSetting'},
                    component: () => import('../components/page/serve/Serve.vue'),
                    meta: { title: '服务管理' },
                    children:[
                        {
					        path: '/serveSetting',
                            name:'serveSetting',
					        component: () => import('../components/page/serve/Setting.vue'),
					        meta: { title: '服务管理' }
					    },
                        {
                            // 拖拽列表组件
                            path: '/Serviceadd',
                            name:'serveSetting',
                            component: () => import(/* webpackChunkName: "drag" */ '../components/page/serve/Serviceadd.vue'),
                            meta: { title: '添加服务' }
                        },        
                        {
					        path: '/serveCategory',
                            name:'serveSetting',
					        component: () => import('../components/page/serve/Category.vue'),
					        meta: { title: '服务类别' }
					    }
                    ]
                },
                {
                    path: '/order',
                    name:'order',
                    redirect:{name:'car'},
                    component: () => import('../components/page/order/Order.vue'),
                    meta: { title: '订单管理' },
                    children:[
                        {
					        path: '/car',
                            name:'car',
					        component: () => import('../components/page/order/Car.vue'),
					        meta: { title: '汽车订单' }
					    },
                        {
					        path: '/service',
                            name:'service',
					        component: () => import('../components/page/order/Service.vue'),
					        meta: { title: '维修订单' }
					    },
                        {
					        path: '/maintain',
                            name:'maintain',
					        component: () => import('../components/page/order/Maintain.vue'),
					        meta: { title: '保养订单' }
					    },
                        {
					        path: '/evaluateSetting',
                            name:'evaluateSetting',
					        component: () => import('../components/page/order/EvaluateSetting.vue'),
					        meta: { title: '评价管理' }
					    },
                        {
                            path: '/Detailedindent',
                            name:'Detailedindent',
                            component: () => import(/* webpackChunkName: "tabs" */ '../components/page/order/Detailedindent.vue'),
                            meta: { title: '订单详情' }
                        },        
                    ]
                },
                {
                    path: '/rescue',
                    name:'rescue',
                    redirect:{name:'rescueTask'},
                    component: () => import('../components/page/rescue/Rescue.vue'),
                    meta: { title: '救援任务' },
                    children:[
                        {
					        path: '/rescueTask',
                            name:'rescueTask',
					        component: () => import('../components/page/rescue/RescueTask.vue'),
					        meta: { title: '救援任务' }
					    }
                    ]
                },
                {
                    path: '/message',
                    name:'message',
                    redirect:{name:'publish'},
                    component: () => import('../components/page/message/Message.vue'),
                    meta: { title: '信息发布' },
                    children:[
                        {
					        path: '/publish',
                            name:'publish',
					        component: () => import('../components/page/message/Publish.vue'),
					        meta: { title: '信息发布' }
					    },
                        {
					        path: '/waitAudit',
                            name:'waitAudit',
					        component: () => import('../components/page/message/WaitAudit.vue'),
					        meta: { title: '待审核' }
					    },
                        {
					        path: '/audited',
                            name:'audited',
					        component: () => import('../components/page/message/Audited.vue'),
					        meta: { title: '已审核' }
					    },
                        {
                            path: '/Processdetails',
                            name:'Processdetails',
                            component: () => import(/* webpackChunkName: "tabs" */ '../components/page/message/Processdetails.vue'),
                            meta: { title: '待审核详情' }
                        },
                        {
                            path: '/Details',
                            name:'Details',
                            component: () => import(/* webpackChunkName: "tabs" */ '../components/page/message/Details.vue'),
                            meta: { title: '详情' }
                        },
                        {
                            path: '/Auditeddetails',
                            name:'Auditeddetails',
                            component: () => import(/* webpackChunkName: "tabs" */ '../components/page/message/Auditeddetails.vue'),
                            meta: { title: '已审核详情' }
                        },
                        {
                            // 富文本编辑器组件
                            path: '/Deliverifrom',
                            name:'Deliverifrom',
                            component: () => import(/* webpackChunkName: "editor" */ '../components/page/message/Deliverifrom.vue'),
                            meta: { title: '信息发布' }
                        },        
                    ]
                },
                {
                    path: '/statistics',
                    name:'statistics',
                    redirect:{name:'statisticsOrder'},
                    component: () => import('../components/page/statistics/Statistics.vue'),
                    meta: { title: '订单统计' },
                    children:[
                        {
					        path: '/statisticsOrder',
                            name:'statisticsOrder',
					        component: () => import('../components/page/statistics/StatisticsOrder.vue'),
					        meta: { title: '订单统计' }
					    }
                    ]
                },
                {
                    path: '/404',
                    component: () => import(/* webpackChunkName: "404" */ '../components/page/404.vue'),
                    meta: { title: '404' }
                },
                {
                    path: '/403',
                    component: () => import(/* webpackChunkName: "403" */ '../components/page/403.vue'),
                    meta: { title: '403' }
                }
            ]
        },
        {
            path: '/login',
            component: () => import(/* webpackChunkName: "login" */ '../components/page/Login.vue'),
            meta: { title: '登录' }
        },
        {
            path: '*',
            redirect: '/404'
        }
    ]
});
